#include <stdio.h>
#include <string.h>
int main(int argc, char const *argv[])
{
    char read_name[128];
    char read_password[128];

    char name[128] = "张三";
    char password[128] = "111";

    int count = 3;

    while (count)
    {
        printf("请输入账号：\n");
        scanf("%s", read_name);

        printf("请输入密码:\n");
        scanf("%s", read_password);

        if ((!strcmp(read_name, name)) && (!strcmp(read_password, password)))
        {

            printf("恭喜登陆成功！\n");
            break;
        }
        else
        {
            if(count==1){
                printf("机会次数用尽，请您15分钟后再试\n");
                --count;
            }
            else{
                printf("登陆失败,你还有%d次机会\n",--count);
            }
        }
    }

    return 0;
}
